# -*-coding:utf-8-*-
'''
File Create by Author:Backpackerxl
Create File Time:2021/10/13/013 20:50
Program IDE:PyCharm
File Name:File.py
  
'''
import json


class File:
    def __init__(self, path):
        self.path = path

    def get_all_data(self):
        with open(self.path, mode="r", encoding="utf8") as f:
            res = json.load(f)

        return res

    def preservation_data(self, stu_data):
        with open(self.path, mode="w", encoding="utf8") as f:
            json.dump(stu_data, f)
